package com.kaibes.core.base.util;

import com.kaibes.core.base.builder.BigDecimalBuilder;

public class UnitUtils {

    public static long byte2kb(long byteSize) {
        return BigDecimalBuilder.newBuilder(byteSize).divide(1024).build().longValue();
    }
    public static double byte2mb(long byteSize) {
        return BigDecimalBuilder.newBuilder(byteSize).divide(1024).divide(1024).setScale(2).build().doubleValue();
    }
    public static double byte2gb(long byteSize) {
        return BigDecimalBuilder.newBuilder(byteSize).divide(1024).divide(1024).divide(1024).setScale(2).build().doubleValue();
    }
    
}
